#include "mydata.h"

MyData::MyData(QObject *parent) : QObject(parent)
{
    count = 1024;
    value = new double[count];
    for(int i = 0; i < static_cast<int>(count); i++){
        value[i] = sin(i/(3.14));
    }
}
unsigned int MyData::getCount()
{
    return count;
}

double * MyData::getValue()
{

    return value;
}
void MyData::reFreshData()
{
    static int add = 0;
    //边界检查i,未处理
    for(int i = 0; i < static_cast<int>(count); i++){
        value[i] = sin((i+add)/(3.14));
    }
    add +=1;
}
